<!--#  layout("/layout/blank.html",{}){  #-->
<div class="row">
	<div class="col-xs-10 col-xs-offset-1">
		<form id="changePwdForm" class="cmxform form-horizontal adminex-form" novalidate="novalidate">
			<div class="form-group ">
				<label for="用户名" class="control-label col-lg-3">旧密码 : </label>
				<div class="col-lg-9">
					<input class="form-control" type="password" placeholder="请输入旧密码" id="old" name="old" data-type='password' data-error='请输入正确的密码' />
				</div>
			</div>
			<div class="form-group ">
				<label class="control-label col-lg-3"> 新密码 : </label>
				<div class="col-lg-9">
					<input class="form-control" type="password" placeholder="请输入新密码" id="new" name="new" data-type='password' data-error='请输入正确的密码'>
				</div>
			</div>

			<div class="form-group ">
				<label class="control-label col-lg-3"> 确认新密码 : </label>
				<div class="col-lg-9">
					<input class="form-control" type="password" placeholder="请确认新密码" id="confirm" name="confirm" data-type='password' data-error='请输入正确的密码'>
				</div>
			</div>

			<div class="pull-right" style="margin-right: 45px">
				<button type="button" class="btn btn-sm btn-primary" onclick="save(this)">
					<i class="fa fa-save"></i> 提交
				</button>
				<button type="button" class="btn btn-sm btn-default" onclick="closePopWindow()">
					<i class="fa fa-undo"></i> 返回
				</button>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
<!--
	function save(btn) {
		if ($('#changePwdForm').validation()) {
			if ($('#new').val() == $('#confirm').val()) {
				$.post(getRootPath() + '/system/changePassword', {
					old : $('#old').val(),
					'new' : $('#new').val()
				}, function(result) {
					if (result.operationState == 'SUCCESS') {
						showMessage('修改成功!');
						setTimeout(function() {
							closePopWindow();
						}, 2000);
					} else {
						showMessage(result.data.reason);
					}
				}, 'json');
			} else {
				validationFail('两次输入的密码不一致!', btn);
			}
		}
	}
//-->
</script>
<!--# } #-->